/** @namespace app.model.UserMessage */
//短消息 与 短消息收件人 的关系表
module.exports = app => {
    const {BOOLEAN, INTEGER} = app.Sequelize;

    const UserMessage = app.model.define('user_message', {
        read: {type: BOOLEAN, defaultValue: false},
        delete: {type: BOOLEAN, defaultValue: false,}
    }, {
        timestamps: false,
        defaultScope: {where: {delete: false}},
        scopes: {
            deleted: {where: {delete: true}},
        },
    });

    return UserMessage;
};